//
//  AsteroidsScene.h
//  Asteroids
//
// This is the CCLayer on which the game takes place. We draw everything on
// an OpenGL Layer.
//
//  Created by Charles@Kollar.com on 8/13/10.
//
//
//  This program is free software: you can redistribute it and/or modify
//  it under the terms of the GNU General Public License as published by
//  the Free Software Foundation, either version 3 of the License, or
//  (at your option) any later version.
//
//  This program is distributed in the hope that it will be useful,
//  but WITHOUT ANY WARRANTY; without even the implied warranty of
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//  GNU General Public License for more details.
//
//  You should have received a copy of the GNU General Public License
//  along with this program.  If not, see <http://www.gnu.org/licenses/>.
//

// When you import this file, you import all the cocos2d classes
#import "cocos2d.h"

// Importing Chipmunk headers
#import "chipmunk.h"

// http://simplythebest.net/sounds/WAV/
#import "SimpleAudioEngine.h"

enum CollisionTypes {
	kColl_UNUSED,
	kColl_Ship,
	kColl_Asteroid,
	kColl_Missile
};

// a 'cpPolyShape' has a validation process that complains if the shape is not a "convex manifold" with a clockwise winding.
// This can be any shape with any winding use for graphics generation...
typedef struct drawablePolyShape{
	int numVerts;
	cpVect *verts;
} drawablePolyShape;


// The 'shipMass' needs to be a global because the 'thrustMagnitudeAndDirection' is based on it...
// Set the mass to 10.0f (arbitrary)
#define SHIP_MASS						(10.0f)

// Used to compute the magnitude of the thrust impulse applied to the ship when the thrusters are fired.
#define THRUST_MULTIPLIER				(-40.0f)

#define MISSILE_MASS					(1.0f)

#define MISSILE_RADIUS					(2.0f)

// The life of a missile is in units of Chipmunk Solver Steps....
// see [self schedule: @selector(step:)];
// in the init method.
#define MISSILE_STEP_LIFE				(200)

// The maximum number of missiles that can be in space at one time...
#define MAX_MISSILES					(20)

#define MISSILE_IMPULSE_MAGNITUDE		(80)

#define INITIAL_ASTEROID_SPLIT_COUNT	(4)

#define MISSILE_HIT_ASTEROID_WAV        @"explosion.wav"


// HelloWorld Layer
@interface AsteroidsLayer : CCLayer <CCTargetedTouchDelegate> 
{
}

- (id)init;
- (void)dealloc;
- (void)step: (ccTime)dt;
- (void)onEnter;
- (void)onExit;
- (void)draw;

@end
